package com.sg.service.impl;

import com.sg.bean.Order;
import com.sg.dao.OrderDao;
import com.sg.service.OrderService;
import com.sg.vo.OrderVO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fyp
 * 订单业务逻辑实现类
 */
@Service
public class OrderServiceImpl implements OrderService {
    Logger logger=Logger.getLogger(OrderServiceImpl.class);
    @Autowired
    OrderDao orderDao;
    @Override
    public List<OrderVO> findAll() {
        return orderDao.findAll();
    }

    @Override
    public Order findById(int orderId) {
        return orderDao.findById(orderId);
    }

    @Override
    public boolean add(Order order) {
        return orderDao.add(order)>0?true:false;
    }

    @Override
    public boolean delete(int[] arrays) {
        return orderDao.delete(arrays)>0?true:false;
    }

    @Override
    public boolean update(Order order) {
        return orderDao.update(order)>0?true:false;
    }

    @Override
    public List<OrderVO> findBusinessId(int businessId) {
        return orderDao.findBusinessId(businessId);
    }
}
